package com.example.multilevelapprovalback.mapper;

import com.example.multilevelapprovalback.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper  //在运行时会自动生成该接口的实现类对象（代理对象），并且将该对象交给IOC容器
public interface UserMapper {
    /**
     * 通过用户名和密码查询对应用户
     *
     * @param user
     * @return
     */
    User getByNameAndPassword(User user);
    @Select("select name,job_number,email,phone,role from user u join role r on u.role_id = r.id")
    List<User> getAllUser();

}
